package com.ll.core.model;

/**
 * 响应的信封
 * 
 * @author lichen6928
 * 
 * @param <K>
 * @param <V>
 */
public class ResponseEnvelope<K, V> implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private ResponseEnvelopeHeader header;
	private ResponseEnvelopeBody<K, V> body;

	public ResponseEnvelope() {
		this.body = new ResponseEnvelopeBody<K, V>();
		this.header = new ResponseEnvelopeHeader();
	}

	public void addParameter(K key, V value) {
		this.body.add(key, value);
	}

	public V getParameter(K key) {
		return this.body.get(key);
	}

	public String getMessage() {
		return header.getMessage();
	}

	public void setMessage(String message) {
		this.header.setMessage(message);
	}

	public String getDetalMessage() {
		return header.getDetalMessage();
	}

	public void setDetalMessage(String detalMessage) {
		this.header.setDetalMessage(detalMessage);
	}

	public int getAppCode() {
		return this.header.getAppCode();
	}

	public void setAppCode(int appCode) {
		this.header.setAppCode(appCode);
	}

	public ResponseEnvelopeBody<K, V> getBody() {
		return this.body;
	}
}
